<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>
<body>
    <script>
        //jsonp 一种跨域的解决方式

        function getData(data) {
            console.log(data)
        }

        function createJsonp() {
            const s = document.createElement('script');
            s.src = 'http://1.php?callback=getData';
            document.body.appendChild(s);
        }
        createJsonp();
    </script>
</body>
</html>